<?php
/**
 * 
 * @authors Liujinbi (857053791@QQ.com)
 * @date    2017-09-12 10:40:44
 * @version $Id$
 */

namespace app\mall\controller;

use think\Db;
use think\Request;
use think\Controller;

class Agent extends Base {
    
    /**
     * 返回管家列表
     * @return [type] [description]
     */
    function index(){
    	$uid = $this->uid;
    	$list = Db::field('e.name,e.nickname,e.phone,e.email')->table('sdzx_employee')->alias('e')
    	->join('sdzx_shop s','e.id=s.agent_id')
    	->join('sdzx_user u','s.shop_id=u.shop_id')
    	->where("u.id={$uid}")
    	->group('e.id')
    	->select();
    	$this->success('success','',$list);
    }
}